import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/Home'),
    redirect: '/article',
    children: [
      { path: 'article', component: () => import('@/views/Layout/Article') },
      { path: 'collect', component: () => import('@/views/Layout/Collect') },
      { path: 'like', component: () => import('@/views/Layout/Like') },
      { path: 'user', component: () => import('@/views/Layout/User') }
    ]
  },
  { path: '/detail', component: () => import('@/views/Detail') },
  { path: '/register', component: () => import('@/views/Register') },
  { path: '/login', component: () => import('@/views/Login') }
]

const router = new VueRouter({
  routes
})

export default router
